﻿using System;
using System.Collections.Generic;
using System.Web;
using Itop.YHPC.Model;
using Itop.YHPC.BLL;

namespace Itop.YHPC.controller {
    public class sysprogController {
        static sysprogBLL bll;

        public static sysprogBLL Bll {
            get {
                if (bll == null)
                    bll=Global.GetService<sysprogBLL>();
                return sysprogController.bll; }
        }
        public static IList<sysprog> GetList(string where){
            return Bll.SelectByWhere(where);
        }
        public static string GetListJson(string where) {
            IList<sysprog> list = Bll.SelectByWhere(where);
            return Newtonsoft.Json.JsonConvert.SerializeObject(list);
        }
        public static object Insert(sysprog obj) {
           return  Bll.Insert(obj);
        }
        public static object Update(sysprog obj) {
            return Bll.Update(obj);
        }
        public static object Delete(string key) {
            return Bll.Delete(key);
        }
        public static object UpdateJson(string strUser) {
            sysprog obj = Newtonsoft.Json.JsonConvert.DeserializeObject<sysprog>(strUser);
            if (obj == null) return null;
            return Bll.Update(obj);
        }
    }
}
